vcNavUnit

A navigation unit used for maintaing vcNavAgents and a single navigation mesh. The mesh defines the walkable areas for the agents in the unit. All agents in the unit share the same navigation mesh. Agents within the same unit can avoid each other during navigation.

See in: Overview

Module: vcCore

Parent: vcObject

Children -

Referenced by: vcNavigation.NavUnits, vcNavigation.createNavUnit(), vcNavigation.findNavUnit()

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
Agentslist[vcNavAgent]RGets a list of vcNavAgents in this unit.
IdStringRWGets or sets an unique id for this vcNavUnit

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
addObstacleNonevcMatrix center,
vcVector boundDiagonal
Adds a rectangular obstacle for navigation agents.
See more
Parameters:
center (vcMatrix): The bound center position of the obstacle expressed in World.
boundDiagonal (vcVector): The dimensions of the obstacle (AABB).
addPathwayNonevcMatrix center,
Real bx,
Real by,
Optional Keyword[fromPoint = vcVector],
Optional Keyword[toPoint = vcVector],
Optional Keyword[areaId = Integer]
Adds a pathway for navigation agents.
See more
Parameters:
center (vcMatrix): The center matrix of the pathway expressed in World.
bx (float): The half-width of the pathway in the local X direction.
by (float): The half-width of the pathway in the local Y direction.
Optional: fromPoint (vcVector): For a directional pathway, defines the start (enter) point for the direction definition.
Optional: toPoint (vcVector): For a directional pathway, defines the end (exit) point for the direction definition.
Optional: areaId (int): An identifier for the pathway. Set for restricted pathways. Multiple pathways can share the same areaId.
addPathwayNonevcMatrix center,
List[vcVector] verts,
Optional Keyword[fromPoint = vcVector],
Optional Keyword[toPoint = vcVector],
Optional Keyword[areaId = Integer]
Adds a pathway for navigation agents.
See more
Parameters:
center (vcMatrix): The center matrix of the pathway expressed in World.
verts (list[vcVector]): Vertices of the pathway polygon expressed in the local coordinates and in CCW (around +Z) order.
Optional: fromPoint (vcVector): For a directional pathway, defines the start (enter) point for the direction definition.
Optional: toPoint (vcVector): For a directional pathway, defines the end (exit) point for the direction definition.
Optional: areaId (int): An identifier for the pathway. Set for restricted pathways. Multiple pathways can share the same areaId.
buildMapBooleanReal maxAgentRadius,
Real maxAgentHeight,
Real walkableHeight,
Boolean keepMeshData
Builds the navigation mesh based on the added pathways, obstacles, and the given agent parameters.
See more
Parameters:
maxAgentRadius (float): The maximum radius of the navigation agents [mm].
maxAgentHeight (float): The maximum height of the navigation agents [mm].
walkableHeight (float): The maximum traversible ledge height for the navigation mesh [mm].
keepMeshData (bool): Set to True to keep the mesh data for later visualization or debugging. Set to False to release the mesh data after building the navigation mesh. Keeping the mesh data will consume more memory.
clearMapNoneNoneClears the navigation mesh data including pathways and obstacle definitions.
createAgentvcNavAgentvcComponent componentCreates or retrieves a navigation agent for the given component.
See more
Parameters:
component (vcComponent): The component to create the agent for. The agent is unique per component.
Returns:
vcNavAgent: The created or existing navigation agent.
deleteNoneNoneDeletes this vcNavUnit.